package com.thead;

/**
 * 测试线程方法
 */
public class TestThread {


    public static void main(String[] args) {

        Runnable r1 = () -> System.out.println("My Lambda Runnable -Start");

        Thread t1 = new Thread(new HeavyWorkRunnable(), "t1");

        Thread t2 = new Thread(new HeavyWorkRunnable(),"t2");
        t1.start();
        t2.start();
        System.out.println("Runnable threads has bean started");

        Thread t3 = new Thread(new HeavyWorkThreadRun("t3"));

        Thread t4 = new Thread(new HeavyWorkThreadRun("t4"));
        t3.start();
        t4.start();

        System.out.println("ThreadRun threads has bean started");

        Thread t5 = new Thread(r1, "t5");
        t5.start();

        System.out.println("My Lambda Runnable -End");
    }


}
